

// For serial communication
#include <stdio.h>       /* Standard input/output definitions */
#include <stdlib.h>
#include <stdint.h>      /* Standard types                    */
#include <unistd.h>      /* UNIX standard function defintion  */
#include <fcntl.h>       /* File control definition           */
#include <errno.h>       /* Error number definition           */
#include <termios.h>     /* POSIX terminal control definition */
#include <sys/ioctl.h>

// For using ROS print
#include <ros/ros.h>

// For boost function pointer   --> included in ros.h
//#include <boost/function.hpp>
//#include <boost/bind.hpp>

class Serial
{
 public:
  Serial(const char* port, int baud);
  ~Serial();

  //int read_until(char* buf, char term);

  boost::function<size_t (const void* str, size_t len)> Write;

 public:
  int fd;
};
